package com.gs.montaditos;

import java.util.HashMap;


public class Order {
	private static HashMap<Integer, Integer> items = new HashMap<Integer, Integer>();
	
	
	public static void reset() {
		items = new HashMap<Integer, Integer>();
	}
	
	public static void add(int id) {
		if(!items.containsKey(id)){
			items.put(id, 1);
		} else{
			items.put(id, items.get(id)+1);
		}
	}
	
	public static void remove(int id) {
		if(items.containsKey(id)){
			int amount = items.get(id);
			if(amount > 1)
				items.put(id, amount-1);
			else
				items.remove(id);
		}
	}
	
	public static HashMap<Integer, Integer> getAll() {
		return items;
	}
}
